//
//  ViewController.m
//  UI23_03_利用NSNotificationCenter实现页面间传值
//
//  Created by Scott on 16/4/11.
//  Copyright © 2016年 Scott. All rights reserved.
//

#import "ViewController.h"

@interface ViewController ()
@property (weak, nonatomic) IBOutlet UILabel *label;

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.
    
    [self notiCenter];
    
}

#pragma mark - 通知中心
- (void)notiCenter {
    
    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(handleNoti:) name:@"changeTitle" object:@"change"];

}

- (void)handleNoti:(NSNotification *)noti {
    
    self.label.text = noti.userInfo[@"content"];
    
    
    
}

- (void)dealloc {
    
    [[NSNotificationCenter defaultCenter] removeObserver:self];
    
    
}

#pragma mark -
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
